package org.parademo.service;

import org.parademo.dao.TopicDao;
import org.parademo.model.TopicEntity;
import org.parademo.web.model.TopicView;

import java.util.List;

public class TopicServiceImpl implements TopicService {

    private final TopicDao topicDao;

    public TopicServiceImpl(TopicDao topicDao) {
        this.topicDao = topicDao;
    }

    @Override
    public TopicEntity getTopicById(long userId) {
        return topicDao.getTopicById(userId);
    }

    @Override
    public List<TopicEntity> getTopics() {
        return topicDao.getTopics();
    }

    @Override
    public TopicEntity getTopicByName(String name) {
        return topicDao.getTopicByName(name);
    }

    @Override
    public long createTopic(TopicView topicView) {
        return topicDao.createTopic(topicView);
    }
}
